import { defHttp } from '/@/utils/http/axios';
import { ApiCommon } from '../common';

const { CUSTOMER_ADMIN_API, BILLING_ADMIN_API, CHARGE_API, READING_ADMIN_API } = ApiCommon;

enum Api {
  USER_INFO = '/user/info', // 综合业务办理查询账户列表
  USER_Charging = '/integrated-business/user/billing/', // 综合业务办理-计费信息
  PREFERENTIAL_LIST = '/preferential-account-used/list', // 优惠方案使用账户列表
  BANK_INFO = '/bank-contact/', // 优惠方案使用账户列表
  BANK_RECORD = '/withholding/admin/record-detail/changxing/latest/', // 获取最近一笔报盘代扣记录
  WALLET_INFO = '/wallet-user/get', // 获得用户钱包信息
  INVOICE_INFO = '/invoice-buyer/get', // 获得发票
  DAILY_INFO = '/integrated-business/dailyStatistics/release', //获得日报信息
  WALLET_PAGE = '/wallet-trade-detail/page', //获得客户钱包交易明细分页
  WATER_PAGE = '/detail/page/finish', //获得客户水表记录
  WITHHOLDING_RECORD = '/withholding/admin/record-detail/changxing/page/', //综合业务办理平台-分页获取用户所有代扣记录
  BANK_LIST = '/bank-contact/list/', // 获取用户银行代扣签约账户信息列表,
  DAILY_DETAIL='/integrated-business/dailyStatisticsDetail/release',// 日报打印
  APPROVAL_BANKUNBIND = '/integrated-business/approval/bankUnbind', // 银行代扣解绑
}
/**
 * @description: 请求的API地址
 */
export const getUserInfoApi = (params: object) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.USER_INFO, params }); // 综合业务办理查询账户列表
export const getUserChargingApi = (user_id: string) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.USER_Charging + user_id }); // 综合业务办理-计费信息
export const getUserPreferentialApi = (params: object) =>
  defHttp.get({ url: BILLING_ADMIN_API + Api.PREFERENTIAL_LIST, params }); // 获得优惠方案使用账户列表
export const getUserBankApi = (user_id: string) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.BANK_INFO + user_id }); // 获得银行代扣信息
export const getUserBankRecordApi = (user_id: string) =>
  defHttp.post({ url: CHARGE_API + Api.BANK_RECORD + user_id }); // 获取最近一笔报盘代扣记录
export const getWalletInfoApi = (params: object) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.WALLET_INFO, params }); // 获得用户钱包信息
export const getWalletInvoiceApi = (params: object) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.INVOICE_INFO, params }); // 获得用户发票
export const getDailyInfoApi = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.DAILY_INFO, data }); // 获得日报信息
export const getWalletPageApi = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.WALLET_PAGE, data }); // 获得客户钱包交易明细分页
export const getWaterPageApi = (data: object) =>
  defHttp.post({ url: READING_ADMIN_API + Api.WATER_PAGE, data }); // 获得客户水表记录
export const getWithholdingRecordApi = (data: object) =>
  defHttp.post({ url: CHARGE_API + Api.WITHHOLDING_RECORD, data }); // 综合业务办理平台-分页获取用户所有代扣记录
export const getBankListApi = (user_id: string) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.BANK_LIST + user_id }); // 获取用户银行代扣签约账户信息列表

export const getDailyDetail=(data:object)=>defHttp.post({url:CUSTOMER_ADMIN_API + Api.DAILY_DETAIL,data})
export const getApprovalBankUnbindApi = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.APPROVAL_BANKUNBIND, data }); // 业务综合办理-银行代扣解绑
